package com.piece.member.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import javax.persistence.*;
import java.io.Serializable;

@Data
@Entity
@NoArgsConstructor
@Table(name = "ums_growth_change_history")
@ApiModel(value = "成长值变化历史记录")
public class UmsGrowthChangeHistory implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", length = 11)
    @ApiModelProperty(value = "主键")
    private Long id;

    @Column(name = "member_id")
    @ApiModelProperty(value = "会员id")
    private Long memberId;

    @Column(name = "change_count")
    @ApiModelProperty(value = "改变的值", notes = "正负计数")
    private Long changeCount;

    @Column(name = "remark")
    @ApiModelProperty(value = "备注")
    private String remark;

    @Column(name = "source")
    @ApiModelProperty(value = "积分来源", notes = "0=人工, 1=充值, 2=购物, 3=活动")
    private String source;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
}
